'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const {
    router,
    controller,
    io
  } = app;
  router.get('/sapi/home', controller.home.index);
  router.post('/api/user', controller.user.create)
  router.post('/api/user/login', controller.user.list)
  router.get('/api/badLogin', controller.user.badLogin)
  router.post('/sapi/room', controller.room.create)

  io.route('gameInfo', controller.game.ping)
  // io.of('/gameInfo').route('/gameInfo', io.controller.game.ping)



  // app.io.of('/')
  app.io.route('chat', app.io.controller.chat.index);

  // app.io.of('/chat')
  app.io.of('/chat').route('chat', app.io.controller.chat.index);
  app.io.of('/login').route('chat', app.io.controller.chat.index);

};